package com.ybwh.springboot2.minio.controller;

import com.xfvape.uid.UidGenerator;
import com.ybwh.springboot2.common.RespData;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;


@Api(tags = "ID生成器")
@Controller
@RequestMapping("/")
public class UidGeneratorController {

    @Resource
    private UidGenerator uidGenerator;


    @ApiOperation(value = "百度ID生成器(用于生成文件唯一名称)", notes = "")
    @ResponseBody
    @GetMapping("/getUid")
    public RespData<Long> getUid() {
        return RespData.successResp(uidGenerator.getUID());
    }


}
